﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Microsoft.WindowsServerSolutions.Administration.ObjectModel;

namespace TV4Home.Server.Vail.AddIn
{
    [ContainsCustomControl]
    public class TopLevelTabPageProvider : PageProvider
    {
        public TopLevelTabPageProvider()
            : base(new Guid("6DF18CF7-30E4-410B-98EB-C06FDB949E29"),
                   "TV4Home",
                   "Manage TV4Home")
        {
        }

        protected override Icon CreateImage()
        {
            return Properties.Resources.ToolbarIcon;
        }

        protected override object CreatePages()
        {
            // if TV Server is not installed, display install page first
            if (Utils.ComponentVerifier.CheckTVServer().Status == Utils.ComponentVerifier.VerificationStatus.NotInstalled)
                return (new object[] { new InstallationSubTabPage(), new StatusSubTabPage(), new TVChannelsSubTabPage(), new SchedulesAndRecordingsSubTabPage(), new TunersAndStreamingClientsSubTabPage() });
            else
                return (new object[] { new TVChannelsSubTabPage(), new SchedulesAndRecordingsSubTabPage(), new TunersAndStreamingClientsSubTabPage(), new StatusSubTabPage(), new InstallationSubTabPage() });
        }
    }
}
